package Demo;//多态

public class Demo3 {
    public static void main(String[] args) {
        introduce No1 = new introduce(20, "saxonmo", "曲靖师范学院");
        Lover no2 = new Lover2();
        No1.myself(no2);


    }
}

class Lover {
    private int age;
    private String name;
    private int high;

    public void setAge(int age) {
        this.age = age;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setHigh(int high) {
        this.high = high;
    }

    public int getAge() {
        return age;
    }

    public String getName() {
        return name;
    }

    public int getHigh() {
        return high;
    }

    public void time() {
        System.out.println();
    }
}

class Lover1 extends Lover {
    public void time() {
        System.out.println("我是一号爱人");
    }
}

class Lover2 extends Lover {
    public void time() {
        System.out.println("我是二号爱人");
    }
}

class introduce {
    int age;
    String name;
    String school;

    public introduce(int age, String name, String school) {
        this.age = age;
        this.name = name;
        this.school = school;
    }

    public void myself(Lover L) {
        System.out.println("我是" + name + "今年有" + age + "岁" + "毕业于" + school);
        L.time();

    }
}
